﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<OnlineLibrary.Linq.tblUser>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

     <h2> Edit </h2>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>    
    <fieldset>
        <legend>Fields</legend>

        <div class="editor-label">
            <label for="UserID">User ID</label>
        </div>
        <div class="editor-field">
            
            <%: Html.TextBoxFor(model => model.UserId)%>
            <%: Html.ValidationMessageFor(model => model.UserId)%>
            
        </div>

        <div class="editor-label">
            <label for="Name">Name</label>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Name)%>
            <%: Html.ValidationMessageFor(model => model.Name)%>
        </div>

        <div class="editor-label">
            <label for="UserName">UserName</label>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.UserName)%>
            <%: Html.ValidationMessageFor(model => model.UserName)%>
        </div>

        <div class="editor-label">
            <label for="Password">Password</label>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.PassWord)%>
            <%: Html.ValidationMessageFor(model => model.PassWord)%>
        </div>

        <div class="editor-label">
            <label for="Address">Address</label>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Address)%>
            <%: Html.ValidationMessageFor(model => model.Address)%>
        </div>


        <div>
        <% if ((Boolean.Parse(Session["Admin"].ToString()) == true || Boolean.Parse(Session["Staff"].ToString()) == true) ) 
       { %>
        <div class="editor-label">
            <label for="Role">Role</label>
        </div>
        <div class="editor-field">
            <%: Html.DropDownList("DDLRoles", ViewData["DDLRoles"] as SelectList)%>

        </div>
        <% }%>
        </div>
        
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <% if ((Boolean.Parse(Session["Admin"].ToString()) == true || Boolean.Parse(Session["Staff"].ToString()) == true) ) 
       { %>
        <% =Html.ActionLink("Back to List", "Index")%>
        <% }%>
    </div>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderNavigation" runat="server">
</asp:Content>
